package com.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.portal.entity.NewsCategory;
import com.portal.mapper.NewsCategoryMapper;
import com.portal.service.NewsCategoryService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 新闻分类服务实现类
 */
@Service
public class NewsCategoryServiceImpl extends ServiceImpl<NewsCategoryMapper, NewsCategory> implements NewsCategoryService {
    
    @Override
    public List<NewsCategory> getEnabledCategories() {
        LambdaQueryWrapper<NewsCategory> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(NewsCategory::getEnabled, true)
               .orderByAsc(NewsCategory::getSort);
        return list(wrapper);
    }
} 